string(REGEX REPLACE ".*/(.+)" \\1 SUB_DIR_NAME ${CMAKE_CURRENT_SOURCE_DIR})
file(GLOB_RECURSE source_files 	"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
								"${CMAKE_CURRENT_SOURCE_DIR}/*.h"
								"${PROJECT_SOURCE_DIR}/*.editorconfig")
group_src_by_dir(source_files)
add_compile_definitions(ASIO_STANDALONE)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
	add_compile_definitions(_WIN32_WINNT=0x0501)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
    link_libraries(pthread)
endif()
add_executable(${SUB_DIR_NAME} ${source_files})
set_target_properties(${SUB_DIR_NAME} PROPERTIES DEBUG_POSTFIX "_d")
set_target_properties(${SUB_DIR_NAME} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/../bin)